/*
 * <p>Copyright® 2009-2022 东软 IT 实训中心版权所有。</p>
 */

package com.max.back.doctor.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.max.back.entity.Doctor;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author 辛凤文 forward.seen@foxmail.com
 * @version 1.0
 * @description <p>
 * <code>DoctorDao</code>
 *
 * </p>
 * @time 2022/7/19 14:13
 * @see
 */
@Repository("doctorDoctorDao")
public interface DoctorDao extends BaseMapper<Doctor> {

    /**
     * 根据挂号ID查找负责接待医生的ID
     *
     * @return
     */
    @Select({
            "SELECT r.DOCTOR_ID ID FROM REGISTRATION r WHERE r.DELETED = 0 AND r.ID = " +
                    "#{registrationId} "
    })
    Doctor selectIdByRegistrationId(@Param("registrationId") String registrationId);
}